import common from './common'

const paths = {
  sendEndInvProjectMaterial: 'online/flow/sendEndInvProjectMaterial',
  getHtmlModelDiagram: 'activiti/getHtmlModelDiagram',
  getColumnByTableName: 'metadata/getColumnByTableName',
  //已办结项目上传新的材料
  uploadProjectMaterials:'project/interfaceMonitor/uploadMaterials',
  //已办结项目删除材料
  deleteProjectMaterialFile:'project/interfaceMonitor/deleteMaterials',
  getReplaceMaterialsRecord:'project/interfaceMonitor/getReplaceMaterialsRecord',
  //获取替换证明材料的文件流
  getReplaceMaterialProofView:'project/interfaceMonitor/getReplaceMaterialProofView'
}
const service = {};
(function (service) {

  //获取构建端配置的流程图
  service.getHtmlModelDiagram = function (modelId) {
    return common.get(paths.getHtmlModelDiagram, { modelId })
  }

  // 获取表对应的列数据
  service.getColumnByTableName = function (dataDefineName) {
    return common.get(paths.getColumnByTableName, { dataDefineName })
  }

  // 投资3.0补推办结后材料附件接口
  service.sendEndInvProjectMaterial = function (param, data) {
    return common.post(paths.sendEndInvProjectMaterial, param, data)
  }

  //已办结项目上传新的材料
  service.uploadProjectMaterials = function (data) {
    return common.post(paths.uploadProjectMaterials, null, data)
  }
  //已办结项目删除材料
  service.deleteProjectMaterialFile = function (data) {
    return common.post(paths.deleteProjectMaterialFile, null,data)
  }
  //获取材料替换记录
  service.getReplaceMaterialsRecord = function (projectId,filterText,currentPage, pageSize) {
    return common.get(paths.getReplaceMaterialsRecord, {projectId,filterText,currentPage,pageSize})
  }

})(service)
export default service
